import http from '@/utils/http';
import request from '@/utils/request';

//后台认证
export async function loginAuth(params) {
  return http.post('/auth', params);
}

//自建账号
//获取分类树
export async function selfBuiltTree(params) {
  return http.get('/sys/user/category/tree', params);
}

//添加分类
export async function selfBuiltTreeAdd(params) {
  return http.post('/sys/user/category/add', params);
}

//编辑用户分类
export async function selfBuiltTreeEdit(params) {
  return http.post('/sys/user/category/edit', params);
}

//删除用户分类
export async function selfBuiltTreeDelete(params) {
  return http.get('/sys/user/category/delete', params);
}

//根据分类查询用户列表
export async function selfBuiltList(params) {
  return http.get('/sys/user/list', params);
}

//创建用户
export async function selfBuiltListAdd(params) {
  return http.post('/sys/user/add', params);
}

//编辑用户
export async function selfBuiltListEdit(params) {
  return http.post('/sys/user/edit', params);
}

//删除用户
export async function selfBuiltListDelete(params) {
  return http.get('/sys/user/delete', params);
}

//用户详情
export async function selfBuiltListInfo(params) {
  return http.get('/sys/user/info', params);
}

//重置密码
export async function selfBuiltPasswordReset(body) {
  return http.postFormData('/sys/user/restPwd', body);
}

//成员和部门
//获取接入信息
export async function memDeptAccessInfo(params) {
  return http.get('/sync/user/access/info', params);
}

//设置接入信息
export async function memDeptAccessSetting(params) {
  return http.post('/sync/user/access/setting', params);
}

//获取成员分类树
export async function memDeptTree(params) {
  return http.get('/sync/user/category/tree', params);
}

//更换对接方式 管理员校验
export async function memDeptAccessValidate(params) {
  return http.post('/sys/user/checkTenantUser', params);
}

//字段信息
export async function memDeptField(params) {
  return http.get('/sync/user/field/info', params);
}

//更新字段
export async function memDeptFieldUpdate(params) {
  return http.post('/sync/user/field/update', params);
}

//删除字段
export async function memDeptFieldRemove(params) {
  return http.get('/sync/user/field/remove', params);
}

//排序字段
export async function memDeptFieldMove(params) {
  return http.post('/sync/user/field/move', params);
}

//同步用户列表
export async function memDeptUserList(params) {
  return http.get('/sync/user/list', params);
}

//同步第三方
export async function memDeptUserSync(params) {
  return http.get('/sync/user/pull', params);
}

//单点登录
export async function sso(params) {
  return http.get('/sso', params);
}